package com.fgcs.pojo;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class PageObject<T> implements Serializable {
    private static final long serialVersionUID = 5666712810809836302L;
    /*总记录数*/
    private Integer rowCount;
    /*当前页记录*/
    private List<T> records;
    /*总页数*/
    private Integer pageCount;
    /*页面大小（每页最多显示多少条记录）*/
    private Integer pageSize;
    /*页码值*/
    private Integer pageCurrent;

    public PageObject(){

    }

    public PageObject(Integer rowCount, List<T> records, Integer pageSize, Integer pageCurrent) {
        this.rowCount = rowCount;
        this.records = records;
        this.pageSize = pageSize;
        this.pageCurrent = pageCurrent;
        this.pageCount=this.rowCount/this.pageSize;
        if(this.rowCount%this.pageSize!=0)
            this.pageCount++;
    }
}
